package com.firesyde.gwt.persistence;

//import com.firesyde.gwt.persistence.guice.bdb.BerkeleyDBModule;
import com.firesyde.gwt.persistence.guice.hibernate.HibernateModule;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Module;

/**
 * Simple extension of RemoteServiceServlet that injects persistence-related dependencies
 * @author dan
 *
 */
public class InjectedRemoteServiceServlet extends RemoteServiceServlet {
	
	/**
	 * create a module and inject dependencies into this class and all spawned classes
	 */
	public InjectedRemoteServiceServlet() {
//		BerkeleyDBModule module = new BerkeleyDBModule("dbEnv", "newsgadget");
		HibernateModule module = new HibernateModule();
		Injector injector = Guice.createInjector(new Module[]{module});
		injector.injectMembers(this);
	}
}
